package com.zuul.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * springCloud相关的一些配置
 *
 * @author beike
 */
@Configuration
public class SpringCloudConfig {

    /**
     * 服务调用工具
     *
     * @return
     * @LoadBalanced 让RestTemplate在请求时拥有客户端负载均衡的能力
     */
    @LoadBalanced
    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
